import model_util
import report_gen


if __name__ == '__main__':
  data_obj=model_util.read_model()
  dataitems,graph,graph_org,graph_degra=model_util.arc_graph(data_obj)

  # start_node=model_util.get_start_node(data_obj["Server"],dataitems,graph)
  # print(start_node)
  # levels=model_util.printBfsLevels(graph,min(start_node[0]),data_obj["Server"],dataitems)
  #cycles =model_util.find_cycle(graph_degra, start_node[0][0],data_obj["Server"],dataitems)

  cycles=model_util.find_cycle(graph_degra,data_obj["Data"],dataitems,True,"static/degra.png")

  model_util.drawgraph(graph_degra,data_obj["Data"],dataitems,True,"static/degra.png")
  model_util.drawgraph(graph_org,data_obj["Data"],dataitems,True,"static/org.png")
  model_util.drawgraph(graph_degra,data_obj["Data"],dataitems,True,"static/degra.png")


  report = report_gen.PDFPSReporte('psreport.pdf',data_obj,graph,dataitems,graph_degra,cycles)